home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / share / ewl / examples / ewl_datepicker_test.c < prev    next >
C/C++ Source or Header  |  2006-01-09  |  2KB  |  58 lines

  1. #include "ewl_test.h"
  2.  
  3.  
  4. static Ewl_Widget* datepicker_button = NULL;
  5.  
  6.  
  7. static void
  8.  __destroy_datepicker_window(Ewl_Widget *main_win , void *ev_data __UNUSED__, void *user_data __UNUSED__)
  9.  {
  10.         ewl_widget_destroy(main_win);
  11.     ewl_callback_append(datepicker_button, EWL_CALLBACK_CLICKED,
  12.                             __create_datepicker_test_window, NULL);
  13.  }
  14.  
  15. void
  16. __create_datepicker_test_window(Ewl_Widget * w, void *ev_data __UNUSED__,
  17.                                         void *user_data __UNUSED__)
  18. {
  19.         Ewl_Widget* datepicker;
  20.         Ewl_Widget* datepicker_win;
  21.     
  22.         datepicker_button = w;    
  23.         datepicker_win= ewl_window_new();
  24.  
  25.         if (w) {
  26.                     ewl_callback_del(w, EWL_CALLBACK_CLICKED,
  27.                                         __create_datepicker_test_window);
  28.                     ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW,
  29.                                     __destroy_datepicker_window, NULL);
  30.             } else {
  31.                     ewl_callback_append(datepicker_win, EWL_CALLBACK_DELETE_WINDOW,
  32.                                         __close_main_window, NULL);
  33.         }
  34.     
  35.         
  36.  
  37.  
  38.         
  39.         ewl_window_title_set(EWL_WINDOW(datepicker_win), "Datepicker");
  40.         ewl_window_name_set(EWL_WINDOW(datepicker_win), "Datepicker");
  41.         ewl_window_class_set(EWL_WINDOW(datepicker_win), "Datepicker");
  42.         ewl_object_size_request(EWL_OBJECT(datepicker_win), 160,40);
  43.  
  44.         
  45.         datepicker = ewl_datepicker_new();
  46.  
  47.  
  48.         ewl_object_fill_policy_set(EWL_OBJECT(datepicker_win), EWL_FLAG_FILL_ALL);
  49.         ewl_container_child_append(EWL_CONTAINER(datepicker_win), datepicker);
  50.         
  51.         ewl_widget_show(datepicker_win);
  52.         ewl_widget_show(datepicker);
  53.  
  54.         /*ewl_callback_append(EWL_WIDGET(cal), EWL_CALLBACK_VALUE_CHANGED,ewl_calendar_test, cal);*/
  55.  
  56.  
  57. }
  58.